﻿using System;
using UnityEngine;
using UnityStandardAssets.ImageEffects;

namespace Studio
{
	// Token: 0x020005E0 RID: 1504
	public class StudioVR : Singleton<StudioVR>
	{
		// Token: 0x170004BB RID: 1211
		// (get) Token: 0x06002678 RID: 9848 RVA: 0x000E10D8 File Offset: 0x000DF2D8
		// (set) Token: 0x06002679 RID: 9849 RVA: 0x000E10E8 File Offset: 0x000DF2E8
		public bool active
		{
			get
			{
				return base.gameObject.activeSelf;
			}
			set
			{
				base.gameObject.SetActive(value);
				this.audioListener.enabled = value;
				if (value)
				{
					this.Reflect();
				}
			}
		}

		// Token: 0x0600267A RID: 9850 RVA: 0x000E1110 File Offset: 0x000DF310
		public void Reflect()
		{
			for (int i = 0; i < this.lightFront.Length; i++)
			{
				this.lightFront[i].color = Singleton<Studio>.Instance.sceneInfo.cameraLightColor;
				this.lightFront[i].intensity = Singleton<Studio>.Instance.sceneInfo.cameraLightIntensity;
			}
			this.transLight.localRotation = Quaternion.Euler(Singleton<Studio>.Instance.sceneInfo.cameraLightRot[0], Singleton<Studio>.Instance.sceneInfo.cameraLightRot[1], 0f);
			this.lightFront[0].shadows = ((!Singleton<Studio>.Instance.sceneInfo.cameraLightShadow) ? LightShadows.None : LightShadows.Soft);
			this.ssaoPro.enabled = Singleton<Studio>.Instance.sceneInfo.enableSSAO;
			this.ssaoPro.Intensity = Singleton<Studio>.Instance.sceneInfo.ssaoIntensity;
			this.ssaoPro.OcclusionColor = Singleton<Studio>.Instance.sceneInfo.ssaoColor;
			this.bloomAndFlares.enabled = Singleton<Studio>.Instance.sceneInfo.enableBloom;
			this.bloomAndFlares.bloomIntensity = Singleton<Studio>.Instance.sceneInfo.bloomIntensity;
			this.vignette.enabled = Singleton<Studio>.Instance.sceneInfo.enableVignette;
			this.vignette.intensity = Singleton<Studio>.Instance.sceneInfo.vignetteVignetting;
			if (!this.controllerInfo.IsNullOrEmpty<StudioVR.ControllerInfo>())
			{
				for (int j = 0; j < this.controllerInfo.Length; j++)
				{
					this.controllerInfo[j].active = true;
				}
			}
		}

		// Token: 0x0600267B RID: 9851 RVA: 0x000E12BC File Offset: 0x000DF4BC
		protected override void Awake()
		{
			if (!base.CheckInstance())
			{
				return;
			}
			UnityEngine.Object.DontDestroyOnLoad(base.gameObject);
		}

		// Token: 0x04002682 RID: 9858
		[SerializeField]
		private Light[] lightFront;

		// Token: 0x04002683 RID: 9859
		[SerializeField]
		private Transform transLight;

		// Token: 0x04002684 RID: 9860
		[SerializeField]
		private SSAOPro ssaoPro;

		// Token: 0x04002685 RID: 9861
		[SerializeField]
		private BloomAndFlares bloomAndFlares;

		// Token: 0x04002686 RID: 9862
		[SerializeField]
		private DepthOfField depthOfField;

		// Token: 0x04002687 RID: 9863
		[SerializeField]
		private VignetteAndChromaticAberration vignette;

		// Token: 0x04002688 RID: 9864
		[SerializeField]
		private StudioVR.ControllerInfo[] controllerInfo;

		// Token: 0x04002689 RID: 9865
		[SerializeField]
		private AudioListener audioListener;

		// Token: 0x020005E1 RID: 1505
		[Serializable]
		private class ControllerInfo
		{
			// Token: 0x170004BC RID: 1212
			// (set) Token: 0x0600267D RID: 9853 RVA: 0x000E12E0 File Offset: 0x000DF4E0
			public bool active
			{
				set
				{
					if (this.tracked.index != SteamVR_TrackedObject.EIndex.None)
					{
						this.obj.SetActive(value);
					}
				}
			}

			// Token: 0x0400268A RID: 9866
			public GameObject obj;

			// Token: 0x0400268B RID: 9867
			public SteamVR_TrackedObject tracked;
		}
	}
}
